package interactivespaces.service.image.depth.internal.openni2.libraries;

import org.bridj.BridJ;
import org.bridj.CRuntime;
import org.bridj.Callback;
import org.bridj.FlagSet;
import org.bridj.IntValuedEnum;
import org.bridj.Pointer;
import org.bridj.TypedPointer;
import org.bridj.ann.Library;
import org.bridj.ann.Name;
import org.bridj.ann.Ptr;
import org.bridj.ann.Runtime;

import java.util.Collections;
import java.util.Iterator;

/**
 * Wrapper for library <b>OpenNI2</b><br>
 * This file was autogenerated by <a
 * href="http://jnaerator.googlecode.com/">JNAerator</a>,<br>
 * a tool written by <a href="http://ochafik.com/">Olivier Chafik</a> that <a
 * href="http://code.google.com/p/jnaerator/wiki/CreditsAndLicense">uses a few
 * opensource projects.</a>.<br>
 * For help, please visit <a
 * href="http://nativelibs4java.googlecode.com/">NativeLibs4Java</a> or <a
 * href="http://bridj.googlecode.com/">BridJ</a> .
 */
@Library("OpenNI2")
@Runtime(CRuntime.class)
public class OpenNI2Library {
  static {
    BridJ.register();
  }

  /**
   * enum values<br>
   * <i>native declaration : OniCEnums.h</i>
   */
  public enum OniStatus implements IntValuedEnum<OniStatus> {
    ONI_STATUS_OK(0), ONI_STATUS_ERROR(1), ONI_STATUS_NOT_IMPLEMENTED(2), ONI_STATUS_NOT_SUPPORTED(3),
    ONI_STATUS_BAD_PARAMETER(4), ONI_STATUS_OUT_OF_FLOW(5), ONI_STATUS_NO_DEVICE(6), ONI_STATUS_TIME_OUT(102);
    OniStatus(long value) {
      this.value = value;
    }

    public final long value;

    @Override
    public long value() {
      return this.value;
    }

    @Override
    public Iterator<OniStatus> iterator() {
      return Collections.singleton(this).iterator();
    }

    public static IntValuedEnum<OniStatus> fromValue(int value) {
      return FlagSet.fromValue(value, values());
    }
  };

  /**
   * enum values<br>
   * <i>native declaration : OniCEnums.h</i>
   */
  public enum OniSensorType implements IntValuedEnum<OniSensorType> {
    ONI_SENSOR_IR(1), ONI_SENSOR_COLOR(2), ONI_SENSOR_DEPTH(3);
    OniSensorType(long value) {
      this.value = value;
    }

    public final long value;

    @Override
    public long value() {
      return this.value;
    }

    @Override
    public Iterator<OniSensorType> iterator() {
      return Collections.singleton(this).iterator();
    }

    public static IntValuedEnum<OniSensorType> fromValue(int value) {
      return FlagSet.fromValue(value, values());
    }
  };

  /**
   * enum values<br>
   * <i>native declaration : OniCEnums.h</i>
   */
  public enum OniPixelFormat implements IntValuedEnum<OniPixelFormat> {
    /** Depth */
    ONI_PIXEL_FORMAT_DEPTH_1_MM(100), ONI_PIXEL_FORMAT_DEPTH_100_UM(101), ONI_PIXEL_FORMAT_SHIFT_9_2(102),
    ONI_PIXEL_FORMAT_SHIFT_9_3(103),
    /** Color */
    ONI_PIXEL_FORMAT_RGB888(200), ONI_PIXEL_FORMAT_YUV422(201), ONI_PIXEL_FORMAT_GRAY8(202), ONI_PIXEL_FORMAT_GRAY16(
        203), ONI_PIXEL_FORMAT_JPEG(204), ONI_PIXEL_FORMAT_YUYV(205);
    OniPixelFormat(long value) {
      this.value = value;
    }

    public final long value;

    @Override
    public long value() {
      return this.value;
    }

    @Override
    public Iterator<OniPixelFormat> iterator() {
      return Collections.singleton(this).iterator();
    }

    public static IntValuedEnum<OniPixelFormat> fromValue(int value) {
      return FlagSet.fromValue(value, values());
    }
  };

  /**
   * enum values<br>
   * <i>native declaration : OniCEnums.h</i>
   */
  public enum OniDeviceState implements IntValuedEnum<OniDeviceState> {
    ONI_DEVICE_STATE_OK(0), ONI_DEVICE_STATE_ERROR(1), ONI_DEVICE_STATE_NOT_READY(2), ONI_DEVICE_STATE_EOF(3);
    OniDeviceState(long value) {
      this.value = value;
    }

    public final long value;

    @Override
    public long value() {
      return this.value;
    }

    @Override
    public Iterator<OniDeviceState> iterator() {
      return Collections.singleton(this).iterator();
    }

    public static IntValuedEnum<OniDeviceState> fromValue(int value) {
      return FlagSet.fromValue(value, values());
    }
  };

  /**
   * enum values<br>
   * <i>native declaration : OniCEnums.h</i>
   */
  public enum OniImageRegistrationMode implements IntValuedEnum<OniImageRegistrationMode> {
    ONI_IMAGE_REGISTRATION_OFF(0), ONI_IMAGE_REGISTRATION_DEPTH_TO_COLOR(1);
    OniImageRegistrationMode(long value) {
      this.value = value;
    }

    public final long value;

    @Override
    public long value() {
      return this.value;
    }

    @Override
    public Iterator<OniImageRegistrationMode> iterator() {
      return Collections.singleton(this).iterator();
    }

    public static IntValuedEnum<OniImageRegistrationMode> fromValue(int value) {
      return FlagSet.fromValue(value, values());
    }
  };

  public static final int ONI_TIMEOUT_NONE = 0;
  public static final int ONI_TIMEOUT_FOREVER = -1;
  /** By implementation */
  public static final int ONI_DEVICE_PROPERTY_FIRMWARE_VERSION = 0;
  /** OniVersion */
  public static final int ONI_DEVICE_PROPERTY_DRIVER_VERSION = 1;
  /** int */
  public static final int ONI_DEVICE_PROPERTY_HARDWARE_VERSION = 2;
  /** string */
  public static final int ONI_DEVICE_PROPERTY_SERIAL_NUMBER = 3;
  /** ?? */
  public static final int ONI_DEVICE_PROPERTY_ERROR_STATE = 4;
  /** OniImageRegistrationMode */
  public static final int ONI_DEVICE_PROPERTY_IMAGE_REGISTRATION = 5;
  /**
   * Files<br>
   * float
   */
  public static final int ONI_DEVICE_PROPERTY_PLAYBACK_SPEED = 100;
  /** OniBool */
  public static final int ONI_DEVICE_PROPERTY_PLAYBACK_REPEAT_ENABLED = 101;
  /** OniCropping* */
  public static final int ONI_STREAM_PROPERTY_CROPPING = 0;
  /** float: radians */
  public static final int ONI_STREAM_PROPERTY_HORIZONTAL_FOV = 1;
  /** float: radians */
  public static final int ONI_STREAM_PROPERTY_VERTICAL_FOV = 2;
  /** OniVideoMode* */
  public static final int ONI_STREAM_PROPERTY_VIDEO_MODE = 3;
  /** int */
  public static final int ONI_STREAM_PROPERTY_MAX_VALUE = 4;
  /** int */
  public static final int ONI_STREAM_PROPERTY_MIN_VALUE = 5;
  /** int */
  public static final int ONI_STREAM_PROPERTY_STRIDE = 6;
  /** OniBool */
  public static final int ONI_STREAM_PROPERTY_MIRRORING = 7;
  /** int */
  public static final int ONI_STREAM_PROPERTY_NUMBER_OF_FRAMES = 8;
  /**
   * Camera<br>
   * OniBool
   */
  public static final int ONI_STREAM_PROPERTY_AUTO_WHITE_BALANCE = 100;
  /** OniBool */
  public static final int ONI_STREAM_PROPERTY_AUTO_EXPOSURE = 101;
  /** int */
  public static final int ONI_STREAM_PROPERTY_EXPOSURE = 102;
  /** int */
  public static final int ONI_STREAM_PROPERTY_GAIN = 103;
  /** OniSeek */
  public static final int ONI_DEVICE_COMMAND_SEEK = 1;
  /** string */
  public static final int DEVICE_PROPERTY_FIRMWARE_VERSION = 0;
  /** OniVersion */
  public static final int DEVICE_PROPERTY_DRIVER_VERSION = 1;
  /** int */
  public static final int DEVICE_PROPERTY_HARDWARE_VERSION = 2;
  /** string */
  public static final int DEVICE_PROPERTY_SERIAL_NUMBER = 3;
  /** ?? */
  public static final int DEVICE_PROPERTY_ERROR_STATE = 4;
  /** OniImageRegistrationMode */
  public static final int DEVICE_PROPERTY_IMAGE_REGISTRATION = 5;
  /**
   * Files<br>
   * float
   */
  public static final int DEVICE_PROPERTY_PLAYBACK_SPEED = 100;
  /** OniBool */
  public static final int DEVICE_PROPERTY_PLAYBACK_REPEAT_ENABLED = 101;
  /** OniCropping* */
  public static final int STREAM_PROPERTY_CROPPING = 0;
  /** float: radians */
  public static final int STREAM_PROPERTY_HORIZONTAL_FOV = 1;
  /** float: radians */
  public static final int STREAM_PROPERTY_VERTICAL_FOV = 2;
  /** OniVideoMode* */
  public static final int STREAM_PROPERTY_VIDEO_MODE = 3;
  /** int */
  public static final int STREAM_PROPERTY_MAX_VALUE = 4;
  /** int */
  public static final int STREAM_PROPERTY_MIN_VALUE = 5;
  /** int */
  public static final int STREAM_PROPERTY_STRIDE = 6;
  /** OniBool */
  public static final int STREAM_PROPERTY_MIRRORING = 7;
  /** int */
  public static final int STREAM_PROPERTY_NUMBER_OF_FRAMES = 8;
  /**
   * Camera<br>
   * OniBool
   */
  public static final int STREAM_PROPERTY_AUTO_WHITE_BALANCE = 100;
  /** OniBool */
  public static final int STREAM_PROPERTY_AUTO_EXPOSURE = 101;
  /** int */
  public static final int STREAM_PROPERTY_EXPOSURE = 102;
  /** int */
  public static final int STREAM_PROPERTY_GAIN = 103;
  /** OniSeek */
  public static final int DEVICE_COMMAND_SEEK = 1;

  /**
   * enum values<br>
   * <i>native declaration : OniEnums.h</i>
   */
  public enum SensorType implements IntValuedEnum<SensorType> {
    SENSOR_IR(1), SENSOR_COLOR(2), SENSOR_DEPTH(3);
    SensorType(long value) {
      this.value = value;
    }

    public final long value;

    @Override
    public long value() {
      return this.value;
    }

    @Override
    public Iterator<SensorType> iterator() {
      return Collections.singleton(this).iterator();
    }

    public static IntValuedEnum<SensorType> fromValue(int value) {
      return FlagSet.fromValue(value, values());
    }
  };

  /**
   * enum values<br>
   * <i>native declaration : OniEnums.h</i>
   */
  public enum PixelFormat implements IntValuedEnum<PixelFormat> {
    /** Depth */
    PIXEL_FORMAT_DEPTH_1_MM(100), PIXEL_FORMAT_DEPTH_100_UM(101), PIXEL_FORMAT_SHIFT_9_2(102), PIXEL_FORMAT_SHIFT_9_3(
        103),
    /** Color */
    PIXEL_FORMAT_RGB888(200), PIXEL_FORMAT_YUV422(201), PIXEL_FORMAT_GRAY8(202), PIXEL_FORMAT_GRAY16(203),
    PIXEL_FORMAT_JPEG(204), PIXEL_FORMAT_YUYV(205);
    PixelFormat(long value) {
      this.value = value;
    }

    public final long value;

    @Override
    public long value() {
      return this.value;
    }

    @Override
    public Iterator<PixelFormat> iterator() {
      return Collections.singleton(this).iterator();
    }

    public static IntValuedEnum<PixelFormat> fromValue(int value) {
      return FlagSet.fromValue(value, values());
    }
  };

  /**
   * enum values<br>
   * <i>native declaration : OniEnums.h</i>
   */
  public enum DeviceState implements IntValuedEnum<DeviceState> {
    DEVICE_STATE_OK(0), DEVICE_STATE_ERROR(1), DEVICE_STATE_NOT_READY(2), DEVICE_STATE_EOF(3);
    DeviceState(long value) {
      this.value = value;
    }

    public final long value;

    @Override
    public long value() {
      return this.value;
    }

    @Override
    public Iterator<DeviceState> iterator() {
      return Collections.singleton(this).iterator();
    }

    public static IntValuedEnum<DeviceState> fromValue(int value) {
      return FlagSet.fromValue(value, values());
    }
  };

  /**
   * enum values<br>
   * <i>native declaration : OniEnums.h</i>
   */
  public enum ImageRegistrationMode implements IntValuedEnum<ImageRegistrationMode> {
    IMAGE_REGISTRATION_OFF(0), IMAGE_REGISTRATION_DEPTH_TO_COLOR(1);
    ImageRegistrationMode(long value) {
      this.value = value;
    }

    public final long value;

    @Override
    public long value() {
      return this.value;
    }

    @Override
    public Iterator<ImageRegistrationMode> iterator() {
      return Collections.singleton(this).iterator();
    }

    public static IntValuedEnum<ImageRegistrationMode> fromValue(int value) {
      return FlagSet.fromValue(value, values());
    }
  };

  public static final int TIMEOUT_NONE = 0;
  public static final int TIMEOUT_FOREVER = -1;
  /** <i>native declaration : OniPlatform.h</i> */
  public static final int ONI_PLATFORM_LINUX_X86 = 2;
  /** <i>native declaration : OniVersion.h</i> */
  public static final int ONI_VERSION_MAINTENANCE = 0;
  /** <i>native declaration : OniVersion.h</i> */
  public static final int ONI_VERSION = 2 * 100000000 + 2 * 1000000 + 0 * 10000 + 33;
  /** <i>native declaration : OniVersion.h</i> */
  public static final int ONI_VERSION_BUILD = 33;
  /** <i>native declaration : OniPlatform.h</i> */
  public static final int ONI_PLATFORM_ANDROID_ARM = 5;
  /** <i>native declaration : OniPlatform.h</i> */
  public static final int ONI_PLATFORM_LINUX_ARM = 3;
  /** <i>native declaration : OniVersion.h</i> */
  public static final int ONI_VERSION_MINOR = 2;
  /** <i>native declaration : OniPlatform.h</i> */
  public static final int ONI_PLATFORM_WIN32 = 1;
  /** <i>native declaration : OniVersion.h</i> */
  public static final int ONI_API_VERSION = (2) * 1000 + (2);
  /** <i>native declaration : OniVersion.h</i> */
  public static final int ONI_VERSION_MAJOR = 2;
  /** <i>native declaration : PS1080.h</i> */
  public static final int XN_IO_MAX_I2C_BUFFER_SIZE = 10;
  /** <i>native declaration : OniPlatform.h</i> */
  public static final int ONI_PLATFORM_MACOSX = 4;
  /** <i>native declaration : PSLink.h</i> */
  public static final int XN_MAX_VERSION_MODIFIER_LENGTH = 16;
  /** <i>native declaration : OniCTypes.h</i> */
  public static final int FALSE = 0;
  /** <i>native declaration : PS1080.h</i> */
  public static final int XN_MAX_LOG_SIZE = 6 * 1024;
  /** <i>native declaration : OniCTypes.h</i> */
  public static final int ONI_MAX_STR = 256;
  /** <i>native declaration : OniVersion.h</i> */
  public static final String ONI_VERSION_STRING = "2";
  /** <i>native declaration : OniVersion.h</i> */
  public static final String ONI_BRIEF_VERSION_STRING = "2";
  /** <i>native declaration : PS1080.h</i> */
  public static final int XN_DEVICE_MAX_STRING_LENGTH = 200;
  /** <i>native declaration : OniCTypes.h</i> */
  public static final int ONI_MAX_SENSORS = 10;
  /** <i>native declaration : OniCTypes.h</i> */
  public static final int TRUE = 1;

  /** <i>native declaration : OniCTypes.h</i> */
  public static abstract class OniNewFrameCallback extends Callback<OniNewFrameCallback> {
    abstract public void apply(OpenNI2Library.OniStreamHandle stream, Pointer<?> pCookie);
  };

  /** <i>native declaration : OniCTypes.h</i> */
  public static abstract class OniGeneralCallback extends Callback<OniGeneralCallback> {
    abstract public void apply(Pointer<?> pCookie);
  };

  /** <i>native declaration : OniCTypes.h</i> */
  public static abstract class OniDeviceInfoCallback extends Callback<OniDeviceInfoCallback> {
    abstract public void apply(Pointer<OniDeviceInfo> pInfo, Pointer<?> pCookie);
  };

  /** <i>native declaration : OniCTypes.h</i> */
  public static abstract class OniDeviceStateCallback extends Callback<OniDeviceStateCallback> {
    abstract public void apply(Pointer<OniDeviceInfo> pInfo, IntValuedEnum<OpenNI2Library.OniDeviceState> deviceState,
        Pointer<?> pCookie);
  };

  /** <i>native declaration : OniCTypes.h</i> */
  public static abstract class OniFrameAllocBufferCallback extends Callback<OniFrameAllocBufferCallback> {
    abstract public Pointer<?> apply(int size, Pointer<?> pCookie);
  };

  /** <i>native declaration : OniCTypes.h</i> */
  public static abstract class OniFrameFreeBufferCallback extends Callback<OniFrameFreeBufferCallback> {
    abstract public void apply(Pointer<?> data, Pointer<?> pCookie);
  };

  /**
   * Initialize OpenNI2. Use ONI_API_VERSION as the version.<br>
   * Original signature : <code>OniStatus oniInitialize(int)</code><br>
   * <i>native declaration : OniCAPI.h:31</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniInitialize(int apiVersion) {
    return FlagSet.fromValue(oniInitialize$2(apiVersion), OpenNI2Library.OniStatus.class);
  }

  @Name("oniInitialize")
  protected native static int oniInitialize$2(int apiVersion);

  /**
   * Shutdown OpenNI2<br>
   * Original signature : <code>void oniShutdown()</code><br>
   * <i>native declaration : OniCAPI.h:33</i>
   */
  native public static void oniShutdown();

  /**
   * Get the list of currently connected device.<br>
   * Each device is represented by its OniDeviceInfo.<br>
   * pDevices will be allocated inside.<br>
   * Original signature :
   * <code>OniStatus oniGetDeviceList(OniDeviceInfo**, int*)</code><br>
   * <i>native declaration : OniCAPI.h:40</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniGetDeviceList(Pointer<Pointer<OniDeviceInfo>> pDevices,
      Pointer<Integer> pNumDevices) {
    return FlagSet.fromValue(oniGetDeviceList(Pointer.getPeer(pDevices), Pointer.getPeer(pNumDevices)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniGetDeviceList(@Ptr long pDevices, @Ptr long pNumDevices);

  /**
   * Release previously allocated device list<br>
   * Original signature :
   * <code>OniStatus oniReleaseDeviceList(OniDeviceInfo*)</code><br>
   * <i>native declaration : OniCAPI.h:42</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniReleaseDeviceList(Pointer<OniDeviceInfo> pDevices) {
    return FlagSet.fromValue(oniReleaseDeviceList(Pointer.getPeer(pDevices)), OpenNI2Library.OniStatus.class);
  }

  protected native static int oniReleaseDeviceList(@Ptr long pDevices);

  /**
   * Original signature :
   * <code>OniStatus oniRegisterDeviceCallbacks(OniDeviceCallbacks*, void*, OniCallbackHandle*)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:44</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniRegisterDeviceCallbacks(
      Pointer<OniDeviceCallbacks> pCallbacks, Pointer<?> pCookie, Pointer<OpenNI2Library.OniCallbackHandle> pHandle) {
    return FlagSet.fromValue(
        oniRegisterDeviceCallbacks(Pointer.getPeer(pCallbacks), Pointer.getPeer(pCookie), Pointer.getPeer(pHandle)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniRegisterDeviceCallbacks(@Ptr long pCallbacks, @Ptr long pCookie, @Ptr long pHandle);

  /**
   * Original signature :
   * <code>void oniUnregisterDeviceCallbacks(OniCallbackHandle)</code><br>
   * <i>native declaration : OniCAPI.h:45</i>
   */
  public static void oniUnregisterDeviceCallbacks(OpenNI2Library.OniCallbackHandle handle) {
    oniUnregisterDeviceCallbacks(Pointer.getPeer(handle));
  }

  protected native static void oniUnregisterDeviceCallbacks(@Ptr long handle);

  /**
   * Wait for any of the streams to have a new frame<br>
   * Original signature :
   * <code>OniStatus oniWaitForAnyStream(OniStreamHandle*, int, int*, int)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:48</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniWaitForAnyStream(
      Pointer<OpenNI2Library.OniStreamHandle> pStreams, int numStreams, Pointer<Integer> pStreamIndex, int timeout) {
    return FlagSet.fromValue(
        oniWaitForAnyStream(Pointer.getPeer(pStreams), numStreams, Pointer.getPeer(pStreamIndex), timeout),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniWaitForAnyStream(@Ptr long pStreams, int numStreams, @Ptr long pStreamIndex,
      int timeout);

  /**
   * Get the current version of OpenNI2<br>
   * Original signature : <code>OniVersion oniGetVersion()</code><br>
   * <i>native declaration : OniCAPI.h:51</i>
   */
  native public static OniVersion oniGetVersion();

  /**
   * Translate from format to number of bytes per pixel. Will return 0 for
   * formats in which the number of bytes per pixel isn't fixed.<br>
   * Original signature :
   * <code>int oniFormatBytesPerPixel(OniPixelFormat)</code><br>
   * <i>native declaration : OniCAPI.h:54</i>
   */
  public static int oniFormatBytesPerPixel(IntValuedEnum<OpenNI2Library.OniPixelFormat> format) {
    return oniFormatBytesPerPixel((int) format.value());
  }

  protected native static int oniFormatBytesPerPixel(int format);

  /**
   * Get internal error<br>
   * Original signature : <code>char* oniGetExtendedError()</code><br>
   * <i>native declaration : OniCAPI.h:57</i>
   */
  public static Pointer<Byte> oniGetExtendedError() {
    return Pointer.pointerToAddress(oniGetExtendedError$2(), Byte.class);
  }

  @Ptr
  @Name("oniGetExtendedError")
  protected native static long oniGetExtendedError$2();

  /**
   * Open a device. Uri can be taken from the matching OniDeviceInfo.<br>
   * Original signature :
   * <code>OniStatus oniDeviceOpen(const char*, OniDeviceHandle*)</code><br>
   * <i>native declaration : OniCAPI.h:62</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniDeviceOpen(Pointer<Byte> uri,
      Pointer<OpenNI2Library.OniDeviceHandle> pDevice) {
    return FlagSet.fromValue(oniDeviceOpen(Pointer.getPeer(uri), Pointer.getPeer(pDevice)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniDeviceOpen(@Ptr long uri, @Ptr long pDevice);

  /**
   * Close a device<br>
   * Original signature : <code>OniStatus oniDeviceClose(OniDeviceHandle)</code><br>
   * <i>native declaration : OniCAPI.h:64</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniDeviceClose(OpenNI2Library.OniDeviceHandle device) {
    return FlagSet.fromValue(oniDeviceClose(Pointer.getPeer(device)), OpenNI2Library.OniStatus.class);
  }

  protected native static int oniDeviceClose(@Ptr long device);

  /**
   * Get the possible configurations available for a specific source, or NULL if
   * the source does not exist.<br>
   * Original signature :
   * <code>OniSensorInfo* oniDeviceGetSensorInfo(OniDeviceHandle, OniSensorType)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:67</i>
   */
  public static Pointer<OniSensorInfo> oniDeviceGetSensorInfo(OpenNI2Library.OniDeviceHandle device,
      IntValuedEnum<OpenNI2Library.OniSensorType> sensorType) {
    return Pointer.pointerToAddress(oniDeviceGetSensorInfo(Pointer.getPeer(device), (int) sensorType.value()),
        OniSensorInfo.class);
  }

  @Ptr
  protected native static long oniDeviceGetSensorInfo(@Ptr long device, int sensorType);

  /**
   * Get the OniDeviceInfo of a certain device.<br>
   * Original signature :
   * <code>OniStatus oniDeviceGetInfo(OniDeviceHandle, OniDeviceInfo*)</code><br>
   * <i>native declaration : OniCAPI.h:70</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniDeviceGetInfo(OpenNI2Library.OniDeviceHandle device,
      Pointer<OniDeviceInfo> pInfo) {
    return FlagSet.fromValue(oniDeviceGetInfo(Pointer.getPeer(device), Pointer.getPeer(pInfo)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniDeviceGetInfo(@Ptr long device, @Ptr long pInfo);

  /**
   * Create a new stream in the device. The stream will originate from the
   * source.<br>
   * Original signature :
   * <code>OniStatus oniDeviceCreateStream(OniDeviceHandle, OniSensorType, OniStreamHandle*)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:73</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniDeviceCreateStream(OpenNI2Library.OniDeviceHandle device,
      IntValuedEnum<OpenNI2Library.OniSensorType> sensorType, Pointer<OpenNI2Library.OniStreamHandle> pStream) {
    return FlagSet.fromValue(
        oniDeviceCreateStream(Pointer.getPeer(device), (int) sensorType.value(), Pointer.getPeer(pStream)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniDeviceCreateStream(@Ptr long device, int sensorType, @Ptr long pStream);

  /**
   * Original signature :
   * <code>OniStatus oniDeviceEnableDepthColorSync(OniDeviceHandle)</code><br>
   * <i>native declaration : OniCAPI.h:75</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniDeviceEnableDepthColorSync(
      OpenNI2Library.OniDeviceHandle device) {
    return FlagSet.fromValue(oniDeviceEnableDepthColorSync(Pointer.getPeer(device)), OpenNI2Library.OniStatus.class);
  }

  protected native static int oniDeviceEnableDepthColorSync(@Ptr long device);

  /**
   * Original signature :
   * <code>void oniDeviceDisableDepthColorSync(OniDeviceHandle)</code><br>
   * <i>native declaration : OniCAPI.h:76</i>
   */
  public static void oniDeviceDisableDepthColorSync(OpenNI2Library.OniDeviceHandle device) {
    oniDeviceDisableDepthColorSync(Pointer.getPeer(device));
  }

  protected native static void oniDeviceDisableDepthColorSync(@Ptr long device);

  /**
   * Original signature :
   * <code>OniBool oniDeviceGetDepthColorSyncEnabled(OniDeviceHandle)</code><br>
   * <i>native declaration : OniCAPI.h:77</i>
   */
  public static int oniDeviceGetDepthColorSyncEnabled(OpenNI2Library.OniDeviceHandle device) {
    return oniDeviceGetDepthColorSyncEnabled(Pointer.getPeer(device));
  }

  protected native static int oniDeviceGetDepthColorSyncEnabled(@Ptr long device);

  /**
   * Set property in the device. Use the properties listed in OniTypes.h:
   * ONI_DEVICE_PROPERTY_..., or specific ones supplied by the device.<br>
   * Original signature :
   * <code>OniStatus oniDeviceSetProperty(OniDeviceHandle, int, const void*, int)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:80</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniDeviceSetProperty(OpenNI2Library.OniDeviceHandle device,
      int propertyId, Pointer<?> data, int dataSize) {
    return FlagSet.fromValue(
        oniDeviceSetProperty(Pointer.getPeer(device), propertyId, Pointer.getPeer(data), dataSize),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniDeviceSetProperty(@Ptr long device, int propertyId, @Ptr long data, int dataSize);

  /**
   * Get property in the device. Use the properties listed in OniTypes.h:
   * ONI_DEVICE_PROPERTY_..., or specific ones supplied by the device.<br>
   * Original signature :
   * <code>OniStatus oniDeviceGetProperty(OniDeviceHandle, int, void*, int*)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:82</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniDeviceGetProperty(OpenNI2Library.OniDeviceHandle device,
      int propertyId, Pointer<?> data, Pointer<Integer> pDataSize) {
    return FlagSet.fromValue(
        oniDeviceGetProperty(Pointer.getPeer(device), propertyId, Pointer.getPeer(data), Pointer.getPeer(pDataSize)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int
      oniDeviceGetProperty(@Ptr long device, int propertyId, @Ptr long data, @Ptr long pDataSize);

  /**
   * Check if the property is supported by the device. Use the properties listed
   * in OniTypes.h: ONI_DEVICE_PROPERTY_..., or specific ones supplied by the
   * device.<br>
   * Original signature :
   * <code>OniBool oniDeviceIsPropertySupported(OniDeviceHandle, int)</code><br>
   * <i>native declaration : OniCAPI.h:84</i>
   */
  public static int oniDeviceIsPropertySupported(OpenNI2Library.OniDeviceHandle device, int propertyId) {
    return oniDeviceIsPropertySupported(Pointer.getPeer(device), propertyId);
  }

  protected native static int oniDeviceIsPropertySupported(@Ptr long device, int propertyId);

  /**
   * Invoke an internal functionality of the device.<br>
   * Original signature :
   * <code>OniStatus oniDeviceInvoke(OniDeviceHandle, int, void*, int)</code><br>
   * <i>native declaration : OniCAPI.h:86</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniDeviceInvoke(OpenNI2Library.OniDeviceHandle device,
      int commandId, Pointer<?> data, int dataSize) {
    return FlagSet.fromValue(oniDeviceInvoke(Pointer.getPeer(device), commandId, Pointer.getPeer(data), dataSize),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniDeviceInvoke(@Ptr long device, int commandId, @Ptr long data, int dataSize);

  /**
   * Check if a command is supported, for invoke<br>
   * Original signature :
   * <code>OniBool oniDeviceIsCommandSupported(OniDeviceHandle, int)</code><br>
   * <i>native declaration : OniCAPI.h:88</i>
   */
  public static int oniDeviceIsCommandSupported(OpenNI2Library.OniDeviceHandle device, int commandId) {
    return oniDeviceIsCommandSupported(Pointer.getPeer(device), commandId);
  }

  protected native static int oniDeviceIsCommandSupported(@Ptr long device, int commandId);

  /**
   * Original signature :
   * <code>OniBool oniDeviceIsImageRegistrationModeSupported(OniDeviceHandle, OniImageRegistrationMode)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:90</i>
   */
  public static int oniDeviceIsImageRegistrationModeSupported(OpenNI2Library.OniDeviceHandle device,
      IntValuedEnum<OpenNI2Library.OniImageRegistrationMode> mode) {
    return oniDeviceIsImageRegistrationModeSupported(Pointer.getPeer(device), (int) mode.value());
  }

  protected native static int oniDeviceIsImageRegistrationModeSupported(@Ptr long device, int mode);

  /**
   * @internal<br> Original signature :
   *               <code>OniStatus oniDeviceOpenEx(const char*, const char*, OniDeviceHandle*)</code>
   * <br>
   *               <i>native declaration : OniCAPI.h:93</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniDeviceOpenEx(Pointer<Byte> uri, Pointer<Byte> mode,
      Pointer<OpenNI2Library.OniDeviceHandle> pDevice) {
    return FlagSet.fromValue(oniDeviceOpenEx(Pointer.getPeer(uri), Pointer.getPeer(mode), Pointer.getPeer(pDevice)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniDeviceOpenEx(@Ptr long uri, @Ptr long mode, @Ptr long pDevice);

  /**
   * Destroy an existing stream<br>
   * Original signature : <code>void oniStreamDestroy(OniStreamHandle)</code><br>
   * <i>native declaration : OniCAPI.h:98</i>
   */
  public static void oniStreamDestroy(OpenNI2Library.OniStreamHandle stream) {
    oniStreamDestroy(Pointer.getPeer(stream));
  }

  protected native static void oniStreamDestroy(@Ptr long stream);

  /**
   * Get the OniSensorInfo of the certain stream.<br>
   * Original signature :
   * <code>OniSensorInfo* oniStreamGetSensorInfo(OniStreamHandle)</code><br>
   * <i>native declaration : OniCAPI.h:101</i>
   */
  public static Pointer<OniSensorInfo> oniStreamGetSensorInfo(OpenNI2Library.OniStreamHandle stream) {
    return Pointer.pointerToAddress(oniStreamGetSensorInfo(Pointer.getPeer(stream)), OniSensorInfo.class);
  }

  @Ptr
  protected native static long oniStreamGetSensorInfo(@Ptr long stream);

  /**
   * Start generating data from the stream.<br>
   * Original signature : <code>OniStatus oniStreamStart(OniStreamHandle)</code><br>
   * <i>native declaration : OniCAPI.h:104</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniStreamStart(OpenNI2Library.OniStreamHandle stream) {
    return FlagSet.fromValue(oniStreamStart(Pointer.getPeer(stream)), OpenNI2Library.OniStatus.class);
  }

  protected native static int oniStreamStart(@Ptr long stream);

  /**
   * Stop generating data from the stream.<br>
   * Original signature : <code>void oniStreamStop(OniStreamHandle)</code><br>
   * <i>native declaration : OniCAPI.h:106</i>
   */
  public static void oniStreamStop(OpenNI2Library.OniStreamHandle stream) {
    oniStreamStop(Pointer.getPeer(stream));
  }

  protected native static void oniStreamStop(@Ptr long stream);

  /**
   * Get the next frame from the stream. This function is blocking until there
   * is a new frame from the stream. For timeout, use oniWaitForStreams() first<br>
   * Original signature :
   * <code>OniStatus oniStreamReadFrame(OniStreamHandle, OniFrame**)</code><br>
   * <i>native declaration : OniCAPI.h:109</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniStreamReadFrame(OpenNI2Library.OniStreamHandle stream,
      Pointer<Pointer<OniFrame>> pFrame) {
    return FlagSet.fromValue(oniStreamReadFrame(Pointer.getPeer(stream), Pointer.getPeer(pFrame)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniStreamReadFrame(@Ptr long stream, @Ptr long pFrame);

  /**
   * Register a callback to when the stream has a new frame.<br>
   * Original signature :
   * <code>OniStatus oniStreamRegisterNewFrameCallback(OniStreamHandle, OniNewFrameCallback, void*, OniCallbackHandle*)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:112</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniStreamRegisterNewFrameCallback(
      OpenNI2Library.OniStreamHandle stream, Pointer<OpenNI2Library.OniNewFrameCallback> handler, Pointer<?> pCookie,
      Pointer<OpenNI2Library.OniCallbackHandle> pHandle) {
    return FlagSet.fromValue(
        oniStreamRegisterNewFrameCallback(Pointer.getPeer(stream), Pointer.getPeer(handler), Pointer.getPeer(pCookie),
            Pointer.getPeer(pHandle)), OpenNI2Library.OniStatus.class);
  }

  protected native static int oniStreamRegisterNewFrameCallback(@Ptr long stream, @Ptr long handler, @Ptr long pCookie,
      @Ptr long pHandle);

  /**
   * Unregister a previously registered callback to when the stream has a new
   * frame.<br>
   * Original signature :
   * <code>void oniStreamUnregisterNewFrameCallback(OniStreamHandle, OniCallbackHandle)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:114</i>
   */
  public static void oniStreamUnregisterNewFrameCallback(OpenNI2Library.OniStreamHandle stream,
      OpenNI2Library.OniCallbackHandle handle) {
    oniStreamUnregisterNewFrameCallback(Pointer.getPeer(stream), Pointer.getPeer(handle));
  }

  protected native static void oniStreamUnregisterNewFrameCallback(@Ptr long stream, @Ptr long handle);

  /**
   * Set property in the stream. Use the properties listed in OniTypes.h:
   * ONI_STREAM_PROPERTY_..., or specific ones supplied by the device for its
   * streams.<br>
   * Original signature :
   * <code>OniStatus oniStreamSetProperty(OniStreamHandle, int, const void*, int)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:117</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniStreamSetProperty(OpenNI2Library.OniStreamHandle stream,
      int propertyId, Pointer<?> data, int dataSize) {
    return FlagSet.fromValue(
        oniStreamSetProperty(Pointer.getPeer(stream), propertyId, Pointer.getPeer(data), dataSize),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniStreamSetProperty(@Ptr long stream, int propertyId, @Ptr long data, int dataSize);

  /**
   * Get property in the stream. Use the properties listed in OniTypes.h:
   * ONI_STREAM_PROPERTY_..., or specific ones supplied by the device for its
   * streams.<br>
   * Original signature :
   * <code>OniStatus oniStreamGetProperty(OniStreamHandle, int, void*, int*)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:119</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniStreamGetProperty(OpenNI2Library.OniStreamHandle stream,
      int propertyId, Pointer<?> data, Pointer<Integer> pDataSize) {
    return FlagSet.fromValue(
        oniStreamGetProperty(Pointer.getPeer(stream), propertyId, Pointer.getPeer(data), Pointer.getPeer(pDataSize)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int
      oniStreamGetProperty(@Ptr long stream, int propertyId, @Ptr long data, @Ptr long pDataSize);

  /**
   * Check if the property is supported the stream. Use the properties listed in
   * OniTypes.h: ONI_STREAM_PROPERTY_..., or specific ones supplied by the
   * device for its streams.<br>
   * Original signature :
   * <code>OniBool oniStreamIsPropertySupported(OniStreamHandle, int)</code><br>
   * <i>native declaration : OniCAPI.h:121</i>
   */
  public static int oniStreamIsPropertySupported(OpenNI2Library.OniStreamHandle stream, int propertyId) {
    return oniStreamIsPropertySupported(Pointer.getPeer(stream), propertyId);
  }

  protected native static int oniStreamIsPropertySupported(@Ptr long stream, int propertyId);

  /**
   * Invoke an internal functionality of the stream.<br>
   * Original signature :
   * <code>OniStatus oniStreamInvoke(OniStreamHandle, int, void*, int)</code><br>
   * <i>native declaration : OniCAPI.h:123</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniStreamInvoke(OpenNI2Library.OniStreamHandle stream,
      int commandId, Pointer<?> data, int dataSize) {
    return FlagSet.fromValue(oniStreamInvoke(Pointer.getPeer(stream), commandId, Pointer.getPeer(data), dataSize),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniStreamInvoke(@Ptr long stream, int commandId, @Ptr long data, int dataSize);

  /**
   * Check if a command is supported, for invoke<br>
   * Original signature :
   * <code>OniBool oniStreamIsCommandSupported(OniStreamHandle, int)</code><br>
   * <i>native declaration : OniCAPI.h:125</i>
   */
  public static int oniStreamIsCommandSupported(OpenNI2Library.OniStreamHandle stream, int commandId) {
    return oniStreamIsCommandSupported(Pointer.getPeer(stream), commandId);
  }

  protected native static int oniStreamIsCommandSupported(@Ptr long stream, int commandId);

  /**
   * Sets the stream buffer allocation functions. Note that this function may
   * only be called while stream is not started.<br>
   * Original signature :
   * <code>OniStatus oniStreamSetFrameBuffersAllocator(OniStreamHandle, OniFrameAllocBufferCallback, OniFrameFreeBufferCallback, void*)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:127</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniStreamSetFrameBuffersAllocator(
      OpenNI2Library.OniStreamHandle stream, Pointer<OpenNI2Library.OniFrameAllocBufferCallback> alloc,
      Pointer<OpenNI2Library.OniFrameFreeBufferCallback> free, Pointer<?> pCookie) {
    return FlagSet.fromValue(
        oniStreamSetFrameBuffersAllocator(Pointer.getPeer(stream), Pointer.getPeer(alloc), Pointer.getPeer(free),
            Pointer.getPeer(pCookie)), OpenNI2Library.OniStatus.class);
  }

  protected native static int oniStreamSetFrameBuffersAllocator(@Ptr long stream, @Ptr long alloc, @Ptr long free,
      @Ptr long pCookie);

  /**
   * Mark another user of the frame.<br>
   * Original signature : <code>void oniFrameAddRef(OniFrame*)</code><br>
   * <i>native declaration : OniCAPI.h:131</i>
   */
  public static void oniFrameAddRef(Pointer<OniFrame> pFrame) {
    oniFrameAddRef(Pointer.getPeer(pFrame));
  }

  protected native static void oniFrameAddRef(@Ptr long pFrame);

  /**
   * Mark that the frame is no longer needed.<br>
   * Original signature : <code>void oniFrameRelease(OniFrame*)</code><br>
   * <i>native declaration : OniCAPI.h:133</i>
   */
  public static void oniFrameRelease(Pointer<OniFrame> pFrame) {
    oniFrameRelease(Pointer.getPeer(pFrame));
  }

  protected native static void oniFrameRelease(@Ptr long pFrame);

  /**
   * Creates a recorder that records to a file.<br>
   *
   * @param [in] fileName The name of the file that will contain the recording.<br>
   * @param [out] pRecorder Points to the handle to the newly created recorder.<br>
   * @retval ONI_STATUS_OK Upon successful completion.<br>
   * @retval ONI_STATUS_ERROR Upon any kind of failure.<br>
   *         Original signature :
   *         <code>OniStatus oniCreateRecorder(const char*, OniRecorderHandle*)</code>
   * <br>
   *         <i>native declaration : OniCAPI.h:145</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniCreateRecorder(Pointer<Byte> fileName,
      Pointer<OpenNI2Library.OniRecorderHandle> pRecorder) {
    return FlagSet.fromValue(oniCreateRecorder(Pointer.getPeer(fileName), Pointer.getPeer(pRecorder)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniCreateRecorder(@Ptr long fileName, @Ptr long pRecorder);

  /**
   * Attaches a stream to a recorder. The amount of attached streams is
   * virtually<br>
   * infinite. You cannot attach a stream after you have started a recording, if<br>
   * you do: an error will be returned by oniRecorderAttachStream.<br>
   *
   * @param [in] recorder The handle to the recorder.<br>
   * @param [in] stream The handle to the stream.<br>
   * @param [in] allowLossyCompression Allows/denies lossy compression<br>
   * @retval ONI_STATUS_OK Upon successful completion.<br>
   * @retval ONI_STATUS_ERROR Upon any kind of failure.<br>
   *         Original signature :
   *         <code>OniStatus oniRecorderAttachStream(OniRecorderHandle, OniStreamHandle, OniBool)</code>
   * <br>
   *         <i>native declaration : OniCAPI.h:157</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniRecorderAttachStream(
      OpenNI2Library.OniRecorderHandle recorder, OpenNI2Library.OniStreamHandle stream, int allowLossyCompression) {
    return FlagSet.fromValue(
        oniRecorderAttachStream(Pointer.getPeer(recorder), Pointer.getPeer(stream), allowLossyCompression),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniRecorderAttachStream(@Ptr long recorder, @Ptr long stream, int allowLossyCompression);

  /**
   * Starts recording. There must be at least one stream attached to the
   * recorder,<br>
   * if not: oniRecorderStart will return an error.<br>
   *
   * @param[in] recorder The handle to the recorder.<br>
   * @retval ONI_STATUS_OK Upon successful completion.<br>
   * @retval ONI_STATUS_ERROR Upon any kind of failure.<br>
   *         Original signature :
   *         <code>OniStatus oniRecorderStart(OniRecorderHandle)</code><br>
   *         <i>native declaration : OniCAPI.h:169</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniRecorderStart(OpenNI2Library.OniRecorderHandle recorder) {
    return FlagSet.fromValue(oniRecorderStart(Pointer.getPeer(recorder)), OpenNI2Library.OniStatus.class);
  }

  protected native static int oniRecorderStart(@Ptr long recorder);

  /**
   * Stops recording. You can resume recording via oniRecorderStart.<br>
   *
   * @param[in] recorder The handle to the recorder.<br>
   * @retval ONI_STATUS_OK Upon successful completion.<br>
   * @retval ONI_STATUS_ERROR Upon any kind of failure.<br>
   *         Original signature :
   *         <code>void oniRecorderStop(OniRecorderHandle)</code><br>
   *         <i>native declaration : OniCAPI.h:177</i>
   */
  public static void oniRecorderStop(OpenNI2Library.OniRecorderHandle recorder) {
    oniRecorderStop(Pointer.getPeer(recorder));
  }

  protected native static void oniRecorderStop(@Ptr long recorder);

  /**
   * Stops recording if needed, and destroys a recorder.<br>
   *
   * @param [in,out] recorder The handle to the recorder, the handle will be<br>
   *        invalidated (nullified) when the function returns.<br>
   * @retval ONI_STATUS_OK Upon successful completion.<br>
   * @retval ONI_STATUS_ERROR Upon any kind of failure.<br>
   *         Original signature :
   *         <code>OniStatus oniRecorderDestroy(OniRecorderHandle*)</code><br>
   *         <i>native declaration : OniCAPI.h:186</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniRecorderDestroy(
      Pointer<OpenNI2Library.OniRecorderHandle> pRecorder) {
    return FlagSet.fromValue(oniRecorderDestroy(Pointer.getPeer(pRecorder)), OpenNI2Library.OniStatus.class);
  }

  protected native static int oniRecorderDestroy(@Ptr long pRecorder);

  /**
   * Original signature :
   * <code>OniStatus oniCoordinateConverterDepthToWorld(OniStreamHandle, float, float, float, float*, float*, float*)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:188</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniCoordinateConverterDepthToWorld(
      OpenNI2Library.OniStreamHandle depthStream, float depthX, float depthY, float depthZ, Pointer<Float> pWorldX,
      Pointer<Float> pWorldY, Pointer<Float> pWorldZ) {
    return FlagSet.fromValue(
        oniCoordinateConverterDepthToWorld(Pointer.getPeer(depthStream), depthX, depthY, depthZ,
            Pointer.getPeer(pWorldX), Pointer.getPeer(pWorldY), Pointer.getPeer(pWorldZ)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniCoordinateConverterDepthToWorld(@Ptr long depthStream, float depthX, float depthY,
      float depthZ, @Ptr long pWorldX, @Ptr long pWorldY, @Ptr long pWorldZ);

  /**
   * Original signature :
   * <code>OniStatus oniCoordinateConverterWorldToDepth(OniStreamHandle, float, float, float, float*, float*, float*)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:190</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniCoordinateConverterWorldToDepth(
      OpenNI2Library.OniStreamHandle depthStream, float worldX, float worldY, float worldZ, Pointer<Float> pDepthX,
      Pointer<Float> pDepthY, Pointer<Float> pDepthZ) {
    return FlagSet.fromValue(
        oniCoordinateConverterWorldToDepth(Pointer.getPeer(depthStream), worldX, worldY, worldZ,
            Pointer.getPeer(pDepthX), Pointer.getPeer(pDepthY), Pointer.getPeer(pDepthZ)),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniCoordinateConverterWorldToDepth(@Ptr long depthStream, float worldX, float worldY,
      float worldZ, @Ptr long pDepthX, @Ptr long pDepthY, @Ptr long pDepthZ);

  /**
   * Original signature :
   * <code>OniStatus oniCoordinateConverterDepthToColor(OniStreamHandle, OniStreamHandle, int, int, OniDepthPixel, int*, int*)</code>
   * <br>
   * <i>native declaration : OniCAPI.h:192</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniCoordinateConverterDepthToColor(
      OpenNI2Library.OniStreamHandle depthStream, OpenNI2Library.OniStreamHandle colorStream, int depthX, int depthY,
      short depthZ, Pointer<Integer> pColorX, Pointer<Integer> pColorY) {
    return FlagSet.fromValue(
        oniCoordinateConverterDepthToColor(Pointer.getPeer(depthStream), Pointer.getPeer(colorStream), depthX, depthY,
            depthZ, Pointer.getPeer(pColorX), Pointer.getPeer(pColorY)), OpenNI2Library.OniStatus.class);
  }

  protected native static int oniCoordinateConverterDepthToColor(@Ptr long depthStream, @Ptr long colorStream,
      int depthX, int depthY, short depthZ, @Ptr long pColorX, @Ptr long pColorY);

  /**
   * Change the log output folder<br>
   *
   * @param const char * strOutputFolder [in] path to the desirebale folder<br>
   *        * @retval ONI_STATUS_OK Upon successful completion.<br>
   * @retval ONI_STATUS_ERROR Upon any kind of failure.<br>
   *         Original signature :
   *         <code>OniStatus oniSetLogOutputFolder(const char*)</code><br>
   *         <i>native declaration : OniCAPI.h:204</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniSetLogOutputFolder(Pointer<Byte> strOutputFolder) {
    return FlagSet.fromValue(oniSetLogOutputFolder(Pointer.getPeer(strOutputFolder)), OpenNI2Library.OniStatus.class);
  }

  protected native static int oniSetLogOutputFolder(@Ptr long strOutputFolder);

  /**
   * Get the current log file name<br>
   *
   * @param char * strFileName [out] hold the returned file name<br>
   * @param int nBufferSize [in] size of strFileName<br>
   *        * @retval ONI_STATUS_OK Upon successful completion.<br>
   * @retval ONI_STATUS_ERROR Upon any kind of failure.<br>
   *         Original signature :
   *         <code>OniStatus oniGetLogFileName(char*, int)</code><br>
   *         <i>native declaration : OniCAPI.h:215</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniGetLogFileName(Pointer<Byte> strFileName, int nBufferSize) {
    return FlagSet.fromValue(oniGetLogFileName(Pointer.getPeer(strFileName), nBufferSize),
        OpenNI2Library.OniStatus.class);
  }

  protected native static int oniGetLogFileName(@Ptr long strFileName, int nBufferSize);

  /**
   * Set the Minimum severity for log produce <br>
   *
   * @param const char * strMask [in] Name of the logger<br>
   *        * @retval ONI_STATUS_OK Upon successful completion.<br>
   * @retval ONI_STATUS_ERROR Upon any kind of failure.<br>
   *         Original signature :
   *         <code>OniStatus oniSetLogMinSeverity(int)</code><br>
   *         <i>native declaration : OniCAPI.h:225</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniSetLogMinSeverity(int nMinSeverity) {
    return FlagSet.fromValue(oniSetLogMinSeverity$2(nMinSeverity), OpenNI2Library.OniStatus.class);
  }

  @Name("oniSetLogMinSeverity")
  protected native static int oniSetLogMinSeverity$2(int nMinSeverity);

  /**
   * Configures if log entries will be printed to console.<br>
   *
   * @param OniBool
   *          bConsoleOutput [in] TRUE to print log entries to console, FALSE
   *          otherwise.<br>
   *          * @retval ONI_STATUS_OK Upon successful completion.<br>
   * @retval ONI_STATUS_ERROR Upon any kind of failure.<br>
   *         Original signature :
   *         <code>OniStatus oniSetLogConsoleOutput(OniBool)</code><br>
   *         <i>native declaration : OniCAPI.h:235</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniSetLogConsoleOutput(int bConsoleOutput) {
    return FlagSet.fromValue(oniSetLogConsoleOutput$2(bConsoleOutput), OpenNI2Library.OniStatus.class);
  }

  @Name("oniSetLogConsoleOutput")
  protected native static int oniSetLogConsoleOutput$2(int bConsoleOutput);

  /**
   * Configures if log entries will be printed to a log file.<br>
   *
   * @param OniBool
   *          bFileOutput [in] TRUE to print log entries to the file, FALSE
   *          otherwise.<br>
   *          * @retval ONI_STATUS_OK Upon successful completion.<br>
   * @retval ONI_STATUS_ERROR Upon any kind of failure.<br>
   *         Original signature :
   *         <code>OniStatus oniSetLogFileOutput(OniBool)</code><br>
   *         <i>native declaration : OniCAPI.h:245</i>
   */
  public static IntValuedEnum<OpenNI2Library.OniStatus> oniSetLogFileOutput(int bFileOutput) {
    return FlagSet.fromValue(oniSetLogFileOutput$2(bFileOutput), OpenNI2Library.OniStatus.class);
  }

  @Name("oniSetLogFileOutput")
  protected native static int oniSetLogFileOutput$2(int bFileOutput);

  public static class OniRecorderHandle extends TypedPointer {
    public OniRecorderHandle(long address) {
      super(address);
    }

    public OniRecorderHandle(Pointer address) {
      super(address);
    }
  };

  public static class OniStreamHandle extends TypedPointer {
    public OniStreamHandle(long address) {
      super(address);
    }

    public OniStreamHandle(Pointer address) {
      super(address);
    }
  };

  public static class OniCallbackHandle extends TypedPointer {
    public OniCallbackHandle(long address) {
      super(address);
    }

    public OniCallbackHandle(Pointer address) {
      super(address);
    }
  };

  public static class OniDeviceHandle extends TypedPointer {
    public OniDeviceHandle(long address) {
      super(address);
    }

    public OniDeviceHandle(Pointer address) {
      super(address);
    }
  };

  /** Undefined type */
  public static interface _OniDevice {

  };

  /** Undefined type */
  public static interface _OniRecorder {

  };

  /** Undefined type */
  public static interface OniCallbackHandleImpl {

  };

  /** Undefined type */
  public static interface _OniStream {

  };
}
